<template>
    <div id="shopp_cart">
			<div class="s_title">
				<h2 class="s_t_width">购物车<a href="Shopping_sel.html" class="s_t_edit">编辑</a></h2>
			</div> 
			<div class="supplier clearfix" v-for="(item,index) of cartList" :key="index">
				<h2 class="supp_title">供货商:易果生鲜<span @click="cartDel(item.id)" class="sprite-icon"></span></h2>
				<dl class="supp_main clearfix">
					<dt class="supp_pic_t">
						<img :src="item.merch.img">
					</dt>
					<dd class="supp_con">
						<span class="supp_c_txt">{{item.name}}</span>
						<span class="supp_c_money">规格：50ml</span>
						<div class="supp_c_price clearfix"><span class="supp_box">{{item.score}}积分</span><p class="supp_c_inpt"><input type="button" value="-" id="plus"><input type="text" id="txt" :value="item.num"><input type="button" value="+" id="reduce"></p></div>
					</dd>
				</dl>
			</div>
			<!-- <div class="supplier clearfix">
				<h2 class="supp_title">供货商:易果生鲜<span class="sprite-icon"></span></h2>
				<dl class="supp_main clearfix">
					<dt class="supp_pic_t">
						<img src="@/assets/images/shoppingcart/inter.png">
					</dt>
					<dd class="supp_con">
						<span class="supp_c_txt">Dior/迪奥小姐花漾淡香氛50ml 甜心女士淡香 EDT 清新甜美</span>
						<span class="supp_c_money">规格：50ml</span>
						<div class="supp_c_price clearfix"><span class="supp_box">1329.0积分</span><p class="supp_c_inpt"><input type="button" value="-" id="plus"><input type="text" id="txt"><input type="button" value="+" id="reduce"></p></div>
					</dd>
				</dl>
			</div>
			<div class="supplier clearfix">
				<h2 class="supp_title">供货商:易果生鲜<span class="sprite-icon"></span></h2>
				<dl class="supp_main clearfix">
					<dt class="supp_pic_t">
						<img src="@/assets/images/shoppingcart/inter.png">
					</dt>
					<dd class="supp_con">
						<span class="supp_c_txt">Dior/迪奥小姐花漾淡香氛50ml 甜心女士淡香 EDT 清新甜美</span>
						<span class="supp_c_money">规格：50ml</span>
						<div class="supp_c_price clearfix"><span class="supp_box">1329.0积分</span><p class="supp_c_inpt"><input type="button" value="-" id="plus"><input type="text" id="txt"><input type="button" value="+" id="reduce"></p></div>
					</dd>
				</dl>
			</div>
			<div class="supplier clearfix">
				<h2 class="supp_title">供货商:易果生鲜<span class="sprite-icon"></span></h2>
				<dl class="supp_main clearfix">
					<dt class="supp_pic_t">
						<img src="@/assets/images/shoppingcart/inter.png">
					</dt>
					<dd class="supp_con">
						<span class="supp_c_txt">Dior/迪奥小姐花漾淡香氛50ml 甜心女士淡香 EDT 清新甜美</span>
						<span class="supp_c_money">规格：50ml</span>
						<div class="supp_c_price clearfix"><span class="supp_box">1329.0积分</span><p class="supp_c_inpt"><input type="button" value="-" id="plus"><input type="text" id="txt"><input type="button" value="+" id="reduce"></p></div>
					</dd>
				</dl>
			</div>
			<div class="supplier clearfix">
				<h2 class="supp_title">供货商:易果生鲜<span class="sprite-icon"></span></h2>
				<dl class="supp_main clearfix">
					<dt class="supp_pic_t">
						<img src="@/assets/images/shoppingcart/inter.png">
					</dt>
					<dd class="supp_con">
						<span class="supp_c_txt">Dior/迪奥小姐花漾淡香氛50ml 甜心女士淡香 EDT 清新甜美</span>
						<span class="supp_c_money">规格：50ml</span>
						<div class="supp_c_price clearfix"><span class="supp_box">1329.0积分</span><p class="supp_c_inpt"><input type="button" value="-" id="plus"><input type="text" id="txt"><input type="button" value="+" id="reduce"></p></div>
					</dd>
				</dl>
			</div> -->

			<div class="con_sub cart_che clearfix">
					<span class="con_color cart_main fl">
						合计:<font>2600积分</font>
						<font class="cart_money">(不包含运费)</font>
					</span>
					<a href="Fill_order.html" class="con_ti fr">确认提交</a>
			</div>
		</div>
</template>
<script>
import {mapGetters} from 'vuex';
export default {
	data(){
		return{
			// cartList:this.$store.state.cartList
		}
	},
	methods:{
		cartDel(id){
			console.log(id);
			this.$store.dispatch('cartDel',id);
		}
	},
	computed:{
		...mapGetters(['getCartList']),
		cartList(){
			return this.$store.state.cartList
		}
	}
}
</script>

<style scoped>
#shopp_cart{
	width: 100%;
	background: #f2f2f2;
	color: #666;
	max-width: 640px;
	min-width: 300px;
	margin: 0 auto;
	font-size: 0.5rem;
	padding-bottom: 226px;
}

.s_title{
	width: 100%;
	height: 40px;
	line-height: 40px;
	text-align: center;
	position: relative;
	background: #fff;
}
.s_title:after{
	content: "";
	width: 100%;
	height: 1px;
	position: absolute;
	left: 0px;
	bottom: 0px;
	border-bottom: 1px solid #ededed;
}
.s_title h2.s_t_width{
	width: 100%;
	float: left;
	font-size: 0.9rem;
}
.s_title h2.s_t_width a.s_t_edit{
	text-align: right;
	margin-right: 5px;
	font-size: 0.7rem;
	color: #ed3341;
	position: absolute;
	right: 0px;
	top: 0rem;
	
}


/*supplier start*/
.supplier{
	width: 100%;
	background: #fbfbfb;
	margin-top: 10px;
}
.supplier h2.supp_title{
	height: 45px;
	line-height: 45px;
	font-size: 0.7rem;
	padding: 0 10px;
}
.supplier h2.supp_title span.sprite-icon{
	width: 16px;
	height: 20px;
	margin-top: 12px;
	background-position: -136px -128px;
	float: right;
}
.supplier dl.supp_main{
	width: 100%;
	background: #fff;
	position: relative;
}
.supplier dl.supp_main dt.supp_pic_t{
	width: 40%;
	padding: 0px 10px 10px 10px;
	float: left;
}
.supplier dl.supp_main dd.supp_con{
	width: 60%;
	float: right;
	margin-top: 10px;
	padding-right: 10px;
}
.supplier dl.supp_main dd.supp_con span.supp_c_txt{
	height: 30px;
	line-height: 1rem;
	font-size: 0.6rem;
}
.supplier dl.supp_main dd.supp_con span.supp_c_money{
	display: block;
	line-height: 32px;
	font-size: 0.5rem;
}
.supplier dl.supp_main dd.supp_con div.supp_c_price{
	width: 100%;
}
.supplier dl.supp_main dd.supp_con div.supp_c_price span.supp_box{
	color: #ed3341;
	font-size: 16px;
}


p.supp_c_inpt{
	width: 40%;
	float: right;
	border: 1px solid #c3c3c3;
	border-radius: 2px;
}
p.supp_c_inpt input#plus{
	width: 25%;
	height: 23px;
	border-right: 1px solid #c3c3c3;
	background: #fff;
}
p.supp_c_inpt input#txt{
	width: 50%;
	height: 23px;
	text-align: center;
}
p.supp_c_inpt input#reduce{
	width: 25%;
	height: 23px;
	border-left: 1px solid #c3c3c3;
	background: #fff;
}
/*supplier end*/


.con_sub{
	width: 100%;
	height: 2rem;
	line-height: 2rem;
	position: fixed;
	bottom: 0px;
	left: 0px;
	right: 0px;
	margin: auto;
	background: #fff;
	text-indent: 0.5rem;
	color: #666;
}
.cart_che{
	bottom: 46px;
}
.cart_che .cart_main{
	height: 50%;
	line-height: 30px;
	position: relative;
}
.cart_che .cart_main font{
	display: inline-block;
}
.cart_che .cart_main font.cart_money{
	position: absolute;
	left: 0px;
	top: 18px;
}
.con_sub span.con_color{
	display: block;
}
.con_sub span.all_style{
	color: #ED0012;
}
.con_sub a{
	display: block;
	width: 3.8rem;
	height: 100%;
	background:#ED0012;
	text-align: center;
	border-radius: 3px 3px 0px 0px;
	font-size: 0.6rem;
	color: #fff;
}
</style>
